file(GLOB PLY_SRC ply.cpp ply/*.cpp ply/*.hpp)

add_library(obj SHARED obj.cpp)
add_library(ply SHARED ${PLY_SRC})
add_library(serialized SHARED serialized.cpp)
add_library(rectangle SHARED rectangle.cpp)
add_library(disk SHARED disk.cpp)
add_library(sphere SHARED sphere.cpp)
add_library(cylinder SHARED cylinder.cpp)
add_library(hair SHARED hair.cpp hair.h)
add_library(shapegroup SHARED shapegroup.cpp shapegroup.h)
add_library(instance SHARED instance.cpp instance.h)
add_library(cube SHARED cube.cpp)
add_library(heightfield SHARED heightfield.cpp)

target_include_directories(ply PRIVATE ${MITSUBA_ROOT_DIR}/src/shapes/)

target_link_libraries(obj mitsuba-python)
target_link_libraries(ply mitsuba-python)
target_link_libraries(serialized mitsuba-python)
target_link_libraries(rectangle mitsuba-python)
target_link_libraries(disk mitsuba-python)
target_link_libraries(sphere mitsuba-python)
target_link_libraries(cylinder mitsuba-python)
target_link_libraries(hair mitsuba-python)
target_link_libraries(shapegroup mitsuba-python)
target_link_libraries(instance mitsuba-python)
target_link_libraries(cube mitsuba-python)
target_link_libraries(heightfield mitsuba-python)

set_target_properties(obj PROPERTIES FOLDER "plugins")
set_target_properties(ply PROPERTIES FOLDER "plugins")
set_target_properties(serialized PROPERTIES FOLDER "plugins")
set_target_properties(rectangle PROPERTIES FOLDER "plugins")
set_target_properties(disk PROPERTIES FOLDER "plugins")
set_target_properties(sphere PROPERTIES FOLDER "plugins")
set_target_properties(cylinder PROPERTIES FOLDER "plugins")
set_target_properties(hair PROPERTIES FOLDER "plugins")
set_target_properties(shapegroup PROPERTIES FOLDER "plugins")
set_target_properties(instance PROPERTIES FOLDER "plugins")
set_target_properties(cube PROPERTIES FOLDER "plugins")
set_target_properties(heightfield PROPERTIES FOLDER "plugins")